import { createRouter, createWebHistory } from 'vue-router';

const routes = [{
    path: '/', // 登录页面
    name: 'login',
    component: () =>
        import('../views/login/Main_login.vue'),
    redirect: 'code',
    children: [{
        path: '/code', // 账号密码登录
        name: 'code',
        component: () =>
            import('../views/login/logins/Login_code.vue')
    },
    {
        path: '/note', // 手机验证码登录
        name: 'note',
        component: () =>
            import('../views/login/logins/Login_note.vue')
    },
    {
        path: '/QR', // 二维码登录
        name: 'QR',
        component: () =>
            import('../views/login/logins/Login_QR.vue')
    }
    ]
}, {
    path: '/home', // 首页
    name: 'home',
    component: () =>
        import('../views/home/Main_home.vue'),
    redirect: 'hompage',
    children: [{
        path: '/hompage', // 首页内容
        name: 'hompage',
        component: () =>
            import('../views/home/homes/HomePage.vue')
    }, {
        path: '/PurchaseContract', // 采购合同
        name: 'PurchaseContract',
        component: () =>
            import('../views/home/homes/PurchaseContract.vue')
    }, {
        path: '/SaleContract', // 销售合同
        name: 'SaleContract',
        component: () =>
            import('../views/home/homes/SaleContract.vue')
    }, {
        path: '/PurchaseOrder', // 采购订单
        name: 'PurchaseOrder',
        component: () =>
            import('../views/home/homes/PurchaseOrder.vue')
    }, {
        path: '/SaleOrder', // 销售订单
        name: 'SaleOrder',
        component: () =>
            import('../views/home/homes/SaleOrder.vue')
    }, {
        path: '/EmployeeInformation', // 员工信息
        name: 'EmployeeInformation',
        component: () =>
            import('../views/home/homes/EmployeeInformation.vue')
    }, {
        path: '/CustomerInformation', // 客户信息
        name: 'CustomerInformation',
        component: () =>
            import('../views/home/homes/CustomerInformation.vue')
    }, {
        path: '/SupplierInformation', // 供应商信息
        name: 'SupplierInformation',
        component: () =>
            import('../views/home/homes/SupplierInformation.vue')
    }, {
        path: '/RoleManagement', // 角色管理
        name: 'RoleManagement',
        component: () =>
            import('../views/home/homes/RoleManagement.vue')
    }, {
        path: '/RightsManagement', // 权限管理
        name: 'RightsManagement',
        component: () =>
            import('../views/home/homes/RightsManagement.vue')
    }, {
        path: '/PersonalCenter', // 个人中心
        name: 'PersonalCenter',
        component: () =>
            import('../views/home/homes/PersonalCenter.vue')
    },]
}];

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
});

export default router;